<table border="1" cellpadding="1" cellspacing="0">
    <tr>
        <th scope="row">ID</th>
        <th scope="row">Họ và Tên</th>
        <th scope="row">Địa chỉ</th>
        <th scope="row">Điện thoại</th>
        <th scope="row">Đi động</th>
        <th scope="row">Email</th>
        <th scope="row">Nợ</th>
        <th scope="row">Xóa</th>
    </tr>
<?php
while($aRow = mysql::fetchSql($aResult)){
?>
    <tr>
        <td><a href="<?php echo func::makeUrl('customer', 'update', $aRow['customerId']); ?>"><?php echo $aRow['customerId']; ?></a></td>
        <td><a href="<?php echo func::makeUrl('customer', 'detail', $aRow['customerId']); ?>"><?php echo $aRow['name']; ?></a></td>
        <td><?php echo $aRow['address']; ?></td>
        <td><?php echo $aRow['homephone']; ?></td>
        <td><?php echo $aRow['cellphone']; ?></td>
        <td><?php echo $aRow['email']; ?></td>
        <td>
            <?php
                $sSql = 'SELECT amount FROM debit WHERE customerId='. $aRow['customerId'];
                $aDebit = mysql::querySql($sSql);
                $aDebitRow = mysql::fetchSql($aDebit);
            ?>
            <?php echo func::numberFormat($aDebitRow['amount']); ?>
        </td>
        <td><a href="<?php echo func::makeUrl('customer', 'delete', $aRow['customerId']); ?>">Xóa</a></td>
    </tr>
<?php
}
$aResult->free();
?>
    <tr>
        <td colspan="8" align="right"><a href="<?php echo  func::makeUrl('customer', 'add'); ?>">Thêm khách hàng</a></td>
    </tr>
</table>